/*
    @file clear.js
*/
/**
 * submit
 * @type {Boolean}
 * @private
 */
var _sbt = false;

/**
 * form name
 * @type {*}
 * @private
 */
var _frm = _frm ? _frm : 'dform';
try {
    if (document.attachEvent) {
        // ie 触发函数
        Dd(_frm).attachEvent("onsubmit", sbt);
    } else {
        // 非 ie
        Dd(_frm).addEventListener("submit", sbt, false);
    }
} catch (e) {
}
/**
 * submit 函数
 */
function sbt() {
    _sbt = true;
}

/**
 * 清空请求
 */
if (isGecko) {
    window.onbeforeunload = function () {
        if (!_sbt) makeRequest('action=clear', AJPath);
    }
} else {
    window.onunload = function () {
        if (!_sbt) makeRequest('action=clear', AJPath);
    }
    if (window.opera) {
        makeRequest('action=clear', AJPath);
    }
}